package com.hschinese.pronunciation.adapter;


import android.content.Context;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;

import com.hschinese.pronunciation.R;
import com.hschinese.pronunciation.bean.AppDataBean;

import java.util.List;

import butterknife.Bind;
import butterknife.ButterKnife;
import studychinese.adapters.AppAdapter;

/**
 * zf 创建于 2017/3/31 16:25.
 */

public class CityChrildGridViewAdapter extends AppAdapter {

    public CityChrildGridViewAdapter(List list, Context context) {
        super(list, context);

    }




    @Override
    public View createView(int position, View convertView, ViewGroup parent) {
        ViewHolder viewHolder = null;
        if (convertView == null) {
            convertView = View.inflate(context, R.layout.item_citycharild_gridview, null);
            viewHolder = new ViewHolder(convertView);
            convertView.setTag(viewHolder);
        } else {
            viewHolder = (ViewHolder) convertView.getTag();
        }
        AppDataBean dataBean = (AppDataBean) list.get(position);
        viewHolder.tv_city_chrild_name.setText(dataBean.getChinese());
        return convertView;
    }




    static class ViewHolder {
        @Bind(R.id.tv_city_chrild_name)
        TextView tv_city_chrild_name;


        ViewHolder(View view) {
            ButterKnife.bind(this, view);
        }
    }
}
